Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Relative link to MDX files in docs partials #50

Merged
merged 7 commits into from
May 18, 2022
Merged

Conversation

Alqanar
Copy link
Contributor

@Alqanar Alqanar commented May 6, 2022

correct relative paths resolving in partial docs
i.e. start realtive paths from the partial file directory, not from place where it is being inserted
example:
main file: docs/page/1.mdx
partial: docs/includes/headers/1.mdx

With this utility path like that
../getting-started
in partial will be pointing to
docs/partials/getting-started
and without:
docs/getting-started


@vercel
Copy link

vercel bot commented May 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
docs ✅ Ready (Inspect) Visit Preview May 18, 2022 at 2:10PM (UTC)

@Alqanar Alqanar marked this pull request as ready for review May 11, 2022 13:43
Copy link

@jeffgaynor jeffgaynor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to test this out locally. Can you include a sample page, or link to a page where this is used in your PR Conversation? It would be good to have that added to a comment in the code as well, so other developers can understand what this does / how to use it / why it's there.

server/remark-includes.ts Outdated Show resolved Hide resolved
iAdramelk
iAdramelk previously approved these changes May 13, 2022
* i.e. start realtive paths from the partial file directory, not from place where it is being inserted
* example:
* main file: docs/page/1.mdx
* partial: docs/partials/headers/1.mdx

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these comments: What is the syntax for partials? Maybe indicate this in the comment:

* main file: docs/page/1.mdx
* partial: (!docs/partials/headers/1.mdx!)
 * With this utility a partial like
 * (!../image.jpg!)

Copy link

@jeffgaynor jeffgaynor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for adding the comments!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants